<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增客户产品信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-info-add">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">客户名称：</label>
                <div class="col-sm-8">
                    <select name="customerCode" class="form-control" th:with="cus=${cwWipCustomerInfo}">
                        <option th:each="dict : ${cus}" th:text="${dict.customerName}" th:value="${dict.customerCode}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">产品类型：</label>
                <div class="col-sm-8">
                    <select name="partType" class="form-control" th:with="type=${@dict.getType('wip_part_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">产品编码：</label>
                <div class="col-sm-8">
                    <input name="partCode" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">产品名称：</label>
                <div class="col-sm-8">
                    <input name="partName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">状态：</label>
                <div class="col-sm-8">
                    <label class="radio-box">
                        <input type="radio" value="0" id="ifConfirm1" name="isActive" checked>启用
                    </label>
                    <label class="radio-box">
                        <input type="radio" value="1" id="ifConfirm2" name="isActive" >停用
                    </label>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "wip/cusproduct";
        $("#form-info-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            console.log("data=" + $('#form-info-add').serialize());
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-info-add').serialize());
            }
        }
    </script>
</body>
</html>